package website.digitalocean.chapter16;

/**
 * @author: longhc@citycloud.com.cn
 * @since: 2023/2/16 9:55
 * @version: 1.0
 */
public class ShoppingCarTest {
    public static void main(String[] args) {
        ShoppingCar shoppingCar = new ShoppingCar();
        shoppingCar.add(new Item("1234", 100));
        shoppingCar.add(new Item("1234", 100));
        shoppingCar.add(new Item("1234", 100));

        // 指定不同的策略
        shoppingCar.pay(new PayPalStrategy("longhc@citycloud.com.cn", "6666"));
        // 指定不同的策略
        shoppingCar.pay(new CreditCardStrategy("lhc", "3123213", "fdfsddafsda", "2023年2月16日10:03:29"));
    }
}
